package twopoints;

/**
 * @ClassName LC283
 * @Description 移动零
 * @Author ZJX
 * @Date 2024/9/27 18:26
 * @Version 1.0
 */
public class LC283 {
    public void moveZeroes(int[] nums) {
        int dest = 0;
        for (int cur = 0; cur < nums.length; cur++) {
            if (nums[cur] != 0){
//                交换
                int temp = nums[dest];
                nums[dest] = nums[cur];
                nums[cur] = temp;
                dest++;
            }
        }
    }
}
